<template>
	<view class="main">
		<view class="user-item" @tap="update()">
				<view class="user-item-word">更新应用</view>
				<view class="icon iconfont icon-jinru user-item-jinru">  </view>
		</view>
		
		<view class="user-item" @tap="direct_to_advise()">
				<view class="user-item-word">意见反馈</view>
				<view class="icon iconfont icon-jinru user-item-jinru">  </view>
		</view>
		
		<view class="user-item" @tap="direct_to_user_agreement()">
				<view class="user-item-word">用户协议</view>
				<view class="icon iconfont icon-jinru user-item-jinru">  </view>
		</view>
		<view class="user-item" @tap="direct_to_secret_policy()">
				<view class="user-item-word">隐私政策</view>
				<view class="icon iconfont icon-jinru user-item-jinru">  </view>
		</view>
		
		<view class="user-item" @tap="withdraw()">
				<view class="user-item-word">注销账号</view>
				<view class="icon iconfont icon-jinru user-item-jinru">  </view>
		</view>
		
		<view class="exit" @tap="User.logout(true)">
				退出当前账号
		</view>
		
		<view class="remain"></view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			update(){
				console.log("检测更新");
				this.lib.Update(true);
			},
			direct_to_user_agreement(){
				uni.navigateTo({
					url:"../user-agreement/user-agreement"
				})
			},
			direct_to_secret_policy(){
				uni.navigateTo({
					url:"../secret-policy/secret-policy"
				})
			},
			direct_to_advise(){
				console.log("ffffddd");
				uni.navigateTo({
					url: "./advise"
				})
			},
			withdraw(){
				uni.showModal({
					title: '注销账号，数据将会丢失',
					content: '确定要注销',
					showCancel: true,
					confirmText: "确定注销",
					success: (res) => {
						if (res.confirm) {
							uni.showToast({ title: '账号注销成功' });
							this.User.logout(false);
						}
					}
				});
			},
		}
	}
</script>

<style scoped>
.user-item{
	padding: 20upx 20upx;
	border-bottom: 10upx solid #f3f3f3;
	border-top: 10upx solid #f3f3f3;
}
.user-item>view{
	display: inline-block;
	font-size: 30upx;
}
.user-item-jinru{
	float: right;
}
.exit{
	height: 100upx;
	font-size: 30upx;
	text-align: center;
	line-height: 100upx;
	color: red;
	border-bottom: 10upx solid #f3f3f3;
}
</style>
